package com.hsogoo.collate.service;

import com.hsogoo.collate.domain.DataSourceConfig;
import com.hsogoo.collate.mapper.DataSourceConfigMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author huangsaigang
 * Created @2019-10-28.
 */
@Slf4j
@Service
public class DataSourceManager {

    @Autowired
    private DataSourceConfigMapper dataSourceConfigMapper;

    public void addDataSourceConfig(DataSourceConfig dataSourceConfig){
        dataSourceConfigMapper.addDataSourceConfig(dataSourceConfig);
    }

    public List<DataSourceConfig> listDataSources(){
        return dataSourceConfigMapper.getDataSourceConfigs();
    }


}
